package com.mrjy.maintain.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mrjy.common.entity.MingrenTeamInfo;
import com.mrjy.maintain.bo.IMingrenTeamInfoBo;
import com.mrjy.maintain.dto.MingrenTeamInfoDTO;
import com.mrjy.share.dto.DistributorInfoDTO;

@RequestMapping("/maintain/mingrenTeamInfo")
@Controller
public class MingrenTeamInfoController {

	@Resource
	private IMingrenTeamInfoBo mingrenTeamInfoBo;
	
	@RequestMapping("/add")
	@ResponseBody
	public Object insert(MingrenTeamInfoDTO info) {
		return mingrenTeamInfoBo.txInsert(info);
	}

	@RequestMapping("/deleteByIds")
	@ResponseBody
	public Object deleteByIds(int[] ids) {		
		return mingrenTeamInfoBo.txDeleteByIds(ids);
	}
	
		
	@RequestMapping("/edit")
	@ResponseBody
	public Object updateById(MingrenTeamInfoDTO info) {
		return mingrenTeamInfoBo.txUpdateById(info);
	}
	
	@RequestMapping("/queryById")
	@ResponseBody
	public Object queryById(int id) {
		return mingrenTeamInfoBo.queryById(id);
	}
	
	@RequestMapping("/queryByUserId")
	@ResponseBody
	public Object queryByUserId(MingrenTeamInfoDTO info) {
		return mingrenTeamInfoBo.queryByUserId(info);
	}
	
	/**
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping("/queryPage")
	@ResponseBody
	public Object queryPage(MingrenTeamInfoDTO dto) {
		return mingrenTeamInfoBo.queryPage(dto);
	}
	
	/**
	 * 禁用、起用
	 * @param ids
	 * @return
	 */
	@RequestMapping("/updateDisableFlag")
	@ResponseBody
	public Object updateDisableFlag(MingrenTeamInfo info) {		
		return mingrenTeamInfoBo.txUpdateDisableFlag(info);
	}	
	/**
	 * 导出家人
	 * @param ids
	 * @return
	 */
	@RequestMapping("/export")
	@ResponseBody
	public Object export(MingrenTeamInfoDTO dto,HttpServletResponse response,HttpSession session){
			return mingrenTeamInfoBo.exportExl(dto,response,session);
	}
}
